package xyz.migle.sc;

import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.cloud.client.discovery.DiscoveryClient;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RestController;

/**
 * 打印服务列表
 */
//@RestController
public class ServicesList {

//    @Autowired
//    DiscoveryClient discoveryClient;
//
//    @GetMapping("/dc")
//    public String dc() {
//
//        String services = "Services: " + discoveryClient.getServices();
//
//        discoveryClient.getInstances("consul-sc").forEach(sid->{
//            System.out.println(sid.getHost()+":"+sid.getPort()+":"+sid.getServiceId() + ":" + sid.getUri());
//        });
//
//        System.out.println(services);
//        return services;
//    }
}
